﻿using Newtonsoft.Json.Linq;
using RestSharp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication3
{
	public partial class WebForm2 : System.Web.UI.Page
    {
        JObject jobj;
        string contentType = "application/json"; //Content-Type

        protected void Page_Load(object sender, EventArgs e)
		{

		}


        RestClient client = new RestClient("http://192.168.2.99:9000");
        protected void Button1_Click(object sender, EventArgs e)
        {
            try
            {
                //打印按钮
                string doc_no = TextBox_doc.Text;
                string copies = TextBox_copies.Text;
                RestRequest request = new RestRequest("api/print/two", Method.Post);
                request.AddParameter(contentType,"{\"doc_no\":\""+doc_no+"\",\"copies\":"+ copies+"}", ParameterType.RequestBody);
                var reponse = client.Execute(request);

            }
            catch (Exception ex)
            {

                //return "连接服务器出错：\r\n" + ex.Message;
            }
          
            //if (jobj == null)
            //{
            //    return;
            //}

            //string employee_name = jobj["employee_NAME"].ToString();
        //  return null;

        }
    }
}